home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vbprnt20.zip / VB4 / VBPRNT32.FRM (.txt) < prev   
Visual Basic Form  |  1996-05-31  |  12KB  |  348 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "VBPrint Functions"
  6.    ClientHeight    =   4230
  7.    ClientLeft      =   1665
  8.    ClientTop       =   3090
  9.    ClientWidth     =   6240
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   4665
  21.    Left            =   1605
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   4230
  24.    ScaleWidth      =   6240
  25.    Top             =   2715
  26.    Width           =   6360
  27.    Begin VB.Frame Frame1 
  28.       Appearance      =   0  'Flat
  29.       BackColor       =   &H00C0C0C0&
  30.       Caption         =   "Printer Features"
  31.       ForeColor       =   &H80000008&
  32.       Height          =   1695
  33.       Left            =   0
  34.       TabIndex        =   11
  35.       Top             =   2460
  36.       Width           =   6180
  37.       Begin VB.ListBox lstRes 
  38.          Appearance      =   0  'Flat
  39.          Height          =   615
  40.          Left            =   5025
  41.          TabIndex        =   17
  42.          Top             =   420
  43.          Width           =   975
  44.       End
  45.       Begin VB.ListBox lstBins 
  46.          Appearance      =   0  'Flat
  47.          Height          =   615
  48.          Left            =   3135
  49.          TabIndex        =   15
  50.          Top             =   420
  51.          Width           =   1785
  52.       End
  53.       Begin VB.ListBox lstPapers 
  54.          Appearance      =   0  'Flat
  55.          Height          =   1200
  56.          Left            =   135
  57.          TabIndex        =   12
  58.          Top             =   420
  59.          Width           =   2940
  60.       End
  61.       Begin VB.Label Label1 
  62.          Appearance      =   0  'Flat
  63.          AutoSize        =   -1  'True
  64.          BackColor       =   &H80000005&
  65.          BackStyle       =   0  'Transparent
  66.          Caption         =   "Resolutions"
  67.          ForeColor       =   &H80000008&
  68.          Height          =   195
  69.          Index           =   5
  70.          Left            =   5025
  71.          TabIndex        =   16
  72.          Top             =   195
  73.          Width           =   1005
  74.       End
  75.       Begin VB.Label Label1 
  76.          Appearance      =   0  'Flat
  77.          AutoSize        =   -1  'True
  78.          BackColor       =   &H80000005&
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "Paper bins"
  81.          ForeColor       =   &H80000008&
  82.          Height          =   195
  83.          Index           =   4
  84.          Left            =   3120
  85.          TabIndex        =   14
  86.          Top             =   195
  87.          Width           =   915
  88.       End
  89.       Begin VB.Label Label1 
  90.          Appearance      =   0  'Flat
  91.          AutoSize        =   -1  'True
  92.          BackColor       =   &H80000005&
  93.          BackStyle       =   0  'Transparent
  94.          Caption         =   "Paper types"
  95.          ForeColor       =   &H80000008&
  96.          Height          =   195
  97.          Index           =   3
  98.          Left            =   135
  99.          TabIndex        =   13
  100.          Top             =   195
  101.          Width           =   1020
  102.       End
  103.    End
  104.    Begin VB.CheckBox chkDefault 
  105.       Appearance      =   0  'Flat
  106.       BackColor       =   &H00C0C0C0&
  107.       Caption         =   "Use Windows defaults in dialog"
  108.       ForeColor       =   &H80000008&
  109.       Height          =   195
  110.       Left            =   75
  111.       TabIndex        =   5
  112.       Top             =   2175
  113.       Width           =   3510
  114.    End
  115.    Begin VB.CheckBox chkPerm 
  116.       Appearance      =   0  'Flat
  117.       BackColor       =   &H00C0C0C0&
  118.       Caption         =   "Make changes permanent"
  119.       ForeColor       =   &H80000008&
  120.       Height          =   195
  121.       Left            =   75
  122.       TabIndex        =   4
  123.       Top             =   1920
  124.       Width           =   2910
  125.    End
  126.    Begin VB.Timer Timer1 
  127.       Enabled         =   0   'False
  128.       Interval        =   1000
  129.       Left            =   6015
  130.       Top             =   9670
  131.    End
  132.    Begin VB.CommandButton cmdBtn 
  133.       Appearance      =   0  'Flat
  134.       BackColor       =   &H80000005&
  135.       Caption         =   "E&xit"
  136.       Height          =   330
  137.       Index           =   2
  138.       Left            =   4710
  139.       TabIndex        =   3
  140.       Top             =   1560
  141.       Width           =   1365
  142.    End
  143.    Begin VB.CommandButton cmdBtn 
  144.       Appearance      =   0  'Flat
  145.       BackColor       =   &H80000005&
  146.       Caption         =   "Show &Dialog"
  147.       Height          =   330
  148.       Index           =   1
  149.       Left            =   4710
  150.       TabIndex        =   2
  151.       Top             =   1170
  152.       Width           =   1365
  153.    End
  154.    Begin VB.CommandButton cmdBtn 
  155.       Appearance      =   0  'Flat
  156.       BackColor       =   &H80000005&
  157.       Caption         =   "&Set Default"
  158.       Height          =   330
  159.       Index           =   0
  160.       Left            =   4710
  161.       TabIndex        =   1
  162.       Top             =   780
  163.       Width           =   1365
  164.    End
  165.    Begin VB.ListBox lstPrinters 
  166.       Appearance      =   0  'Flat
  167.       Height          =   1590
  168.       Left            =   60
  169.       TabIndex        =   0
  170.       Top             =   255
  171.       Width           =   3270
  172.    End
  173.    Begin VB.Label lblDefDriver 
  174.       Appearance      =   0  'Flat
  175.       BackColor       =   &H00FFFFFF&
  176.       BackStyle       =   0  'Transparent
  177.       ForeColor       =   &H00FFFFFF&
  178.       Height          =   195
  179.       Left            =   4050
  180.       TabIndex        =   10
  181.       Top             =   510
  182.       Width           =   1410
  183.    End
  184.    Begin VB.Label Label1 
  185.       Appearance      =   0  'Flat
  186.       AutoSize        =   -1  'True
  187.       BackColor       =   &H80000005&
  188.       BackStyle       =   0  'Transparent
  189.       Caption         =   "Driver:"
  190.       ForeColor       =   &H80000008&
  191.       Height          =   195
  192.       Index           =   2
  193.       Left            =   3420
  194.       TabIndex        =   9
  195.       Top             =   525
  196.       Width           =   585
  197.    End
  198.    Begin VB.Label lblDefault 
  199.       Appearance      =   0  'Flat
  200.       BackColor       =   &H00FFFFFF&
  201.       BackStyle       =   0  'Transparent
  202.       ForeColor       =   &H00FFFFFF&
  203.       Height          =   195
  204.       Left            =   3420
  205.       TabIndex        =   8
  206.       Top             =   270
  207.       Width           =   2610
  208.    End
  209.    Begin VB.Label Label1 
  210.       Appearance      =   0  'Flat
  211.       AutoSize        =   -1  'True
  212.       BackColor       =   &H80000005&
  213.       BackStyle       =   0  'Transparent
  214.       Caption         =   "Current default printer:"
  215.       ForeColor       =   &H80000008&
  216.       Height          =   195
  217.       Index           =   1
  218.       Left            =   3420
  219.       TabIndex        =   7
  220.       Top             =   30
  221.       Width           =   1935
  222.    End
  223.    Begin VB.Label Label1 
  224.       Appearance      =   0  'Flat
  225.       AutoSize        =   -1  'True
  226.       BackColor       =   &H80000005&
  227.       BackStyle       =   0  'Transparent
  228.       Caption         =   "Installed printers"
  229.       ForeColor       =   &H80000008&
  230.       Height          =   195
  231.       Index           =   0
  232.       Left            =   60
  233.       TabIndex        =   6
  234.       Top             =   30
  235.       Width           =   1425
  236.    End
  237. Attribute VB_Name = "frmMain"
  238. Attribute VB_Creatable = False
  239. Attribute VB_Exposed = False
  240. DefInt I
  241. DefLng L
  242. DefStr S
  243. Option Explicit
  244. Dim Shared DeviceData() As DEVMODE_TYPE
  245. Private Sub cmdBtn_Click(Index As Integer)
  246.   Dim iRet As Integer
  247.   Dim inMode As DEVMODE_TYPE
  248.   Dim outMode As DEVMODE_TYPE
  249.   Dim sTemp As String
  250.   Dim iMode As Integer
  251.   Dim sTemp2 As String
  252.   Select Case Index
  253.     Case 0
  254.       If lstPrinters.ListIndex = True Then Exit Sub
  255.       sTemp = lstPrinters.List(lstPrinters.ListIndex)
  256.       iRet = VBSetDefPrinter(sTemp)
  257.       If iRet <> True Then MsgBox "Error setting default printer", 48, "Error"
  258.       Timer1_Timer
  259.     Case 1
  260.       If lstPrinters.ListIndex = True Then Exit Sub
  261.       sTemp = lstPrinters.List(lstPrinters.ListIndex)
  262.       iMode = DM_OUT_BUFFER Or DM_IN_PROMP